from rest_framework import serializers

from apps.goods.models import GoodsVisitCount
from apps.users.models import User
# 商品分类数量序列化器
class GoodSerializer(serializers.ModelSerializer):
    category = serializers.StringRelatedField(read_only=True)
    class Meta:
        model = GoodsVisitCount
        fields = ('count', 'category')
# 用户信息序列化器
class UserSerializer(serializers.ModelSerializer):
    class Meta:
        model =User
        fields = ("id","username","mobile","email")